package com.xt.mes;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
public class MesApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(MesApplication.class, args);
        System.out.println("swagger的文档地址： http://localhost:8066/doc.html ");
    }

    /** * 重写addResourceHandlers，可以访问 http://localhost:8066/doc.html  文档 * @param registry */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
    }

}
